{% extends "projects/project_edit_base.html" %}

{% load i18n %}

{% block title %}{% trans "Edit Domains" %}{% endblock %}

{% block nav-dashboard %} class="active"{% endblock %}

{% block editing-option-edit-proj %}class="active"{% endblock %}

{% block project-domains-active %}active{% endblock %}
{% block project_edit_content_header %}{% trans "Domains" %}{% endblock %}

{% block project_edit_content %}
  <p class="help_text">
    {% blocktrans trimmed with docs_url='https://docs.readthedocs.io/page/custom_domains.html' %}
        Configuring a custom domain allows you to serve your documentation from a domain other than "{{ default_domain }}". <a href="{{ docs_url }}">Learn more</a>.
    {% endblocktrans %}
  </p>

  {% if object_list %}
  <h3> {% trans "Existing Domains" %} </h3>
  <p>
    <ul>
    {% for domain in object_list %}
        <li class="{% if domain.machine %}domain-machine{% endif %} {% if domain.canonical %}domain-canonical{% endif %}" >
        {{ domain.domain }}
        (<a href="{% url 'projects_domains_edit' project.slug domain.pk %}">{% trans "Details" %}</a>)
        (<a href="{% url 'projects_domains_delete' project.slug domain.pk %}">{% trans "Remove" %}</a>)
        </li>
    {% endfor %}
    </ul>
  </p>
  {% endif %}

  <h3> {% trans "Add new Domain" %} </h3>
  <form method="post" action="{% url 'projects_domains_create' project.slug %}">{% csrf_token %}
    {{ form.as_p }}
    <p>
      <input style="display: inline;" type="submit" value="{% trans "Add" %}">
    </p>
  </form>
{% endblock %}
